﻿using OSS.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OSS.Service
{
    public interface IUserService:IBaseService<User>
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="account">操作员输入的用户名</param>
        /// <param name="password">操作员输入的密码</param>
        /// <returns>当用户名和密码成功匹配时返回匹配的用户信息，否则返回null</returns>
        User Login(string account, string password);


        void Create(User user, string hdSelectedIds);//创建user实体

        /// <summary>
        /// 根据id删除实体
        /// </summary>
        /// <param name="id">要删除对象的id</param>
        void SwitchStatus(int id);


        /// <summary>
        /// 帐号重复性检测
        /// </summary>
        /// <param name="id">帐号对应的ID值</param>
        /// <param name="account">要判断的帐号名</param>
        /// <returns></returns>
        bool AccountCheck(int? id, string account);

        /// <summary>
        /// 分配用户对应的角色
        /// </summary>
        /// <param name="userId">要修改的userID</param>
        /// <param name="rolesId">用,隔开的多个角色ID</param>
        void AssignRole(int userId, string rolesId);
    }
}

